﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AdminPanel.aspx.cs" Inherits="ADECMS.UserPages.AdminPanel" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
     <link href="../Css/ADEStylesheet.css" rel="stylesheet" type="text/css" />
     <style type="text/css">
    .hiddencol
    {
        display:none;
    }
    .viscol
    {
        display:block;
    }
         .style1
         {
             height: 518px;
         }
     </style>

</head>
<body>
    <form id="form1" runat="server">

                    <asp:ScriptManager ID="ScriptManager1" runat="server">
                    </asp:ScriptManager>
        <table style="height: 150px;">
            <tr>
                <td style="font-family: Segoe Script; font-size: 48px; color: Purple; width: 20%;">
                    <a href="Start.aspx" style="font-family: Segoe Script; font-size: 48px; color: Purple; width: 20%; text-decoration:none;">
                    ADE
                    </a>
                </td>
                <td>
                    <asp:Label ID="Label5" runat="server" CssClass="inputLabel"></asp:Label>
                    &nbsp;
                &nbsp;<asp:LinqDataSource ID="LinqDataSource3" runat="server" ContextTypeName="ADECMS.ADECMSDBDataContext"
                        OrderBy="id desc" Select="new (title)" TableName="NEWs">
                    </asp:LinqDataSource>
                </td>
            </tr>            
            <tr>
                <td colspan="2" style="height: 45px;">
                    &nbsp;
                </td>
            </tr>
        </table>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Menu ID="Menu1" runat="server" Height="35px" onmenuitemclick="Menu1_MenuItemClick" 
                        Orientation="Horizontal" Width="664px" MaximumDynamicDisplayLevels="4" 
                    DisappearAfter="2000" Font-Bold="True" Font-Size="Small" ForeColor="Black">
                    <DynamicHoverStyle BackColor="#666666" />
                    <DynamicMenuStyle BackColor="Silver" />
                    <DynamicMenuItemStyle BackColor="Silver" />
                    <StaticHoverStyle BackColor="Gray" />
                    <Items>
                        <asp:MenuItem Text="Sign out" Value="Sign out"></asp:MenuItem>
                        <asp:MenuItem Text="Novosti" Value="Novosti">
                            <asp:MenuItem Text="Dodaj novost" Value="Dodaj novost" 
                                    Target="/UserPages/AddNews.aspx"></asp:MenuItem>
                            <asp:MenuItem Target="/UserPages/Search.aspx" 
                                    Text="Pretraga" Value="Pretraga"></asp:MenuItem>
                        </asp:MenuItem>
                        <asp:MenuItem Text="File manager" Value="File manager">
                            <asp:MenuItem Text="File upload" Value="File upload"></asp:MenuItem>
                             <asp:MenuItem Text="File download" Value="File download"></asp:MenuItem>
                        </asp:MenuItem>
                        <asp:MenuItem Text="Slide manager" Value="Slide manager">
                            <asp:MenuItem Text="Upload prezentacije" Value="Upload prezentacije">
                            </asp:MenuItem>
                            <asp:MenuItem Text="Pregled prezentacije" Value="Pregled prezentacije">
                            </asp:MenuItem>
                        </asp:MenuItem>
                        <asp:MenuItem Text="Profili" Value="Profili">
                            <asp:MenuItem Text="Pregledaj profil" 
                                    Value="Pregledaj profil"></asp:MenuItem>
                            <asp:MenuItem Text="Edituj profil" Value="Edituj profil"></asp:MenuItem>
                        </asp:MenuItem>
                    </Items>
                </asp:Menu>
            </ContentTemplate>
        </asp:UpdatePanel>
        <table>
            <tr style="height:20px">
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr style="height:20px">
                <td>
                    <asp:Label ID="Label3" runat="server" Text="Administratorski panel" 
                        CssClass="registracijaHeader"></asp:Label>
                </td>
            </tr>
        </table>
        <table>
            <tr>
                <td class="style1" valign="top">
                    <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="2"
                        Width="985px" Height="926px" style="margin-top: 74px">
                            <cc1:TabPanel runat="server" HeaderText="Korisnici" ID="TabPanel1">
                                <ContentTemplate>
                                    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                        <ContentTemplate>
                                            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                                                AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
                                                DataKeyNames="id" DataSourceID="LinqDataSource1" ForeColor="#333333" 
                                                GridLines="None" OnRowCreated="GridView1_RowCreated" 
                                                OnRowDeleting="GridView1_RowDeleting">
                                                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                                <Columns>
                                                    <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                                                    <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
                                                        ReadOnly="True" SortExpression="id" />
                                                    <asp:BoundField DataField="username" HeaderText="username" 
                                                        SortExpression="username" />
                                                    <asp:BoundField DataField="password" HeaderText="password" 
                                                        SortExpression="password" />
                                                    <asp:BoundField DataField="name" HeaderText="name" SortExpression="name" />
                                                    <asp:BoundField DataField="surname" HeaderText="surname" 
                                                        SortExpression="surname" />
                                                    <asp:BoundField DataField="email" HeaderText="email" SortExpression="email" />
                                                    <asp:BoundField DataField="registration_date" HeaderText="registration_date" 
                                                        SortExpression="registration_date" />
                                                    <asp:CheckBoxField DataField="ban" HeaderText="ban" SortExpression="ban" />
                                                    <asp:BoundField DataField="user_type_id" HeaderText="user_type_id" 
                                                        SortExpression="user_type_id" />
                                                </Columns>
                                                <EditRowStyle BackColor="#999999" />
                                                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                            </asp:GridView>
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
                                    <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
                                        ContextTypeName="ADECMS.ADECMSDBDataContext" EnableDelete="True" 
                                        EnableUpdate="True" TableName="USERs">
                                    </asp:LinqDataSource>
                                    <asp:LinqDataSource ID="LinqDataSource2" runat="server" 
                                        ContextTypeName="ADECMS.ADECMSDBDataContext" Select="new (name)" 
                                        TableName="CATEGORies">
                                    </asp:LinqDataSource>
                                </ContentTemplate>
                            </cc1:TabPanel>
                            <cc1:TabPanel runat="server" HeaderText="Novosti" ID="TabPanel2">
                                <ContentTemplate>
                                    <asp:Label ID="Label1" runat="server" 
                                    Text="Brisanje kategorija za novosti:"></asp:Label>
                                    <br />
                                    <asp:Label ID="Label119" runat="server" Text="Odaberite kategoriju:"></asp:Label>
                                    <asp:DropDownList ID="DropKategorija0" runat="server" AutoPostBack="True" 
                                         DataSourceID="LinqDataSource5" DataTextField="name" DataValueField="name">
                                    </asp:DropDownList>
                                    <asp:LinqDataSource ID="LinqDataSource5" runat="server" 
                                         ContextTypeName="ADECMS.ADECMSDBDataContext" OrderBy="id desc" 
                                         Select="new (name)" TableName="CATEGORies" Where="type == @type">
                                        <WhereParameters>
                                            <asp:Parameter DefaultValue="news" Name="type" Type="String" />
                                        </WhereParameters>
                                    </asp:LinqDataSource>
                                    <asp:Button ID="btnBrisiKategorijuN" runat="server" 
                                         onclick="btnIzbrisiKategorijuN_Click" Text="Izbrisi kategoriju" />
                                    <br />
                                    <br />
                                    <asp:Label ID="Label121" runat="server" 
                                         Text="Upišite kategoriju koju želite dodati:"></asp:Label>
                                    <asp:TextBox ID="NazivNKategorije" runat="server" style="margin-left: 19px" 
                                         Width="160px"></asp:TextBox>
                                    <asp:Button ID="btnDodajNKategoriju" runat="server" 
                                         onclick="DodajNKategoriju_Click" style="margin-left: 12px" 
                                         Text="Dodaj kategoriju" />
                                    <br />
                                    <br />
                                    <asp:GridView ID="GridView2" runat="server" AllowPaging="True" 
                                        AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
                                        DataKeyNames="id" DataSourceID="LinqDataSource6" ForeColor="#333333" 
                                        GridLines="None" onrowcreated="GridView2_RowCreated" 
                                        onrowdeleting="GridView2_RowDeleting">
                                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                        <Columns>
                                            <asp:CommandField ShowDeleteButton="True" />
                                            <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
                                                ReadOnly="True" SortExpression="id" />
                                            <asp:BoundField DataField="text" HeaderText="text" SortExpression="text" />
                                            <asp:BoundField DataField="title" HeaderText="title" SortExpression="title" />
                                            <asp:BoundField DataField="news_date" HeaderText="news_date" 
                                                SortExpression="news_date" />
                                            <asp:BoundField DataField="category_id" HeaderText="category_id" 
                                                SortExpression="category_id" />
                                            <asp:BoundField DataField="user_id" HeaderText="user_id" 
                                                SortExpression="user_id" />
                                        </Columns>
                                        <EditRowStyle BackColor="#999999" />
                                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                    </asp:GridView>
                                    <asp:LinqDataSource ID="LinqDataSource6" runat="server" 
                                        ContextTypeName="ADECMS.ADECMSDBDataContext" EnableDelete="True" 
                                        OrderBy="id desc" TableName="NEWs">
                                    </asp:LinqDataSource>
                                    <hr />
                                    <asp:GridView ID="GridView3" runat="server" AllowPaging="True" 
                                        AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
                                        DataKeyNames="id" DataSourceID="LinqDataSource7" ForeColor="#333333" 
                                        GridLines="None">
                                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                        <Columns>
                                            <asp:CommandField ShowDeleteButton="True" />
                                            <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
                                                ReadOnly="True" SortExpression="id" />
                                            <asp:BoundField DataField="text" HeaderText="text" SortExpression="text" />
                                            <asp:BoundField DataField="comment_date" HeaderText="comment_date" 
                                                SortExpression="comment_date" />
                                            <asp:BoundField DataField="user_id" HeaderText="user_id" 
                                                SortExpression="user_id" />
                                            <asp:BoundField DataField="news_id" HeaderText="news_id" 
                                                SortExpression="news_id" />
                                        </Columns>
                                        <EditRowStyle BackColor="#999999" />
                                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                    </asp:GridView>
                                    <br />
                                    <asp:LinqDataSource ID="LinqDataSource7" runat="server" 
                                        ContextTypeName="ADECMS.ADECMSDBDataContext" EnableDelete="True" 
                                        OrderBy="id desc" TableName="COMMENTs">
                                    </asp:LinqDataSource>
                                </ContentTemplate>
                            </cc1:TabPanel>
                            <cc1:TabPanel runat="server" HeaderText="File-ovi" ID="TabPanel3">
                                <ContentTemplate>
                                    <asp:Label ID="Label2" runat="server" 
                                    Text="Brisanje kategorija za file-ove:"></asp:Label>
                                    <br />
                                    <asp:Label ID="Label6" runat="server" Text="Odaberite kategoriju:"></asp:Label>
                                    <asp:DropDownList ID="DropKategorija" runat="server" AutoPostBack="True" 
                                         DataSourceID="LinqDataSource4" DataTextField="name" DataValueField="name">
                                    </asp:DropDownList>
                                    <asp:LinqDataSource ID="LinqDataSource4" runat="server" 
                                         ContextTypeName="ADECMS.ADECMSDBDataContext" OrderBy="id desc" 
                                         Select="new (name)" TableName="CATEGORies" Where="type == @type">
                                         <WhereParameters>
                                             <asp:Parameter DefaultValue="file" Name="type" Type="String" />
                                         </WhereParameters>
                                    </asp:LinqDataSource>
                                    <asp:Button ID="btnIzbrisiKategorijuF" runat="server" 
                                         onclick="btnIzbrisiKategorijuF_Click" Text="Izbrisi kategoriju" />
                                    <br />
                                    <br />
                                    <asp:Label ID="Label120" runat="server" 
                                         Text="Upišite kategoriju koju želite dodati:"></asp:Label>
                                    <asp:TextBox ID="NazivFKategorije" runat="server" style="margin-left: 19px" 
                                         Width="160px"></asp:TextBox>
                                    <asp:Button ID="btnDodajFKategoriju" runat="server" 
                                         onclick="DodajFKategoriju_Click" style="margin-left: 12px" 
                                         Text="Dodaj kategoriju" />
                                    <br />
                                    <br />
                                    <asp:GridView ID="GridView4" runat="server" AllowPaging="True" 
                                        AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
                                        DataKeyNames="id" datasourceid="LinqDataSource8" ForeColor="#333333" 
                                        GridLines="None" onrowcreated="GridView4_RowCreated">
                                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                        <Columns>
                                            <asp:CommandField ShowDeleteButton="True" />
                                            <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
                                                ReadOnly="True" SortExpression="id" />
                                            <asp:BoundField DataField="name" HeaderText="name" SortExpression="name" />
                                            <asp:BoundField DataField="file_date" HeaderText="file_date" 
                                                SortExpression="file_date" />
                                            <asp:BoundField DataField="description" HeaderText="description" 
                                                SortExpression="description" />
                                            <asp:BoundField DataField="category_id" HeaderText="category_id" 
                                                SortExpression="category_id" />
                                            <asp:BoundField DataField="user_id" HeaderText="user_id" 
                                                SortExpression="user_id" />
                                            <asp:BoundField DataField="type" HeaderText="type" SortExpression="type" />
                                        </Columns>
                                        <EditRowStyle BackColor="#999999" />
                                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                    </asp:GridView>
                                    <asp:LinqDataSource ID="LinqDataSource8" runat="server" 
                                        ContextTypeName="ADECMS.ADECMSDBDataContext" EnableDelete="True" 
                                        OrderBy="id desc" TableName="FILEs">
                                    </asp:LinqDataSource>
                            </ContentTemplate>
                        </cc1:TabPanel>
                    </cc1:TabContainer>
                </td>
            </tr>
        </table> 
    </form>
</body>
</html>
